Skip to content

python3Packages.json-schema-to-pydantic: fix tests for pydantic 2.13#539737

Merged
philiptaron merged 1 commit into
NixOS:masterfrom
philiptaron:json-schema-to-pydantic-pydantic-2.13-tests
Jul 8, 2026
Merged

python3Packages.json-schema-to-pydantic: fix tests for pydantic 2.13#539737
philiptaron merged 1 commit into
NixOS:masterfrom
philiptaron:json-schema-to-pydantic-pydantic-2.13-tests

Conversation

@philiptaron

Copy link
Copy Markdown
Contributor

The package has two tests (test_one_of_with_ref and test_one_of_populate_by_name) which hardcoded accesses to annotation.__args__, but pydantic 2.13 wraps the field annotation in Annotated, raising AttributeError when the tests try to get at these guts. Yuck.

I chose to fix it by backporting the upstream test fix which unwraps Annotated before reading the union members.

No change to the production library code.

Things done

@PhilipTaronQ

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 539737
Commit: 594b29e60e7b60a323afefca739881df8dcc0abf


x86_64-linux

✅ 4 packages built:
  • python313Packages.json-schema-to-pydantic
  • python313Packages.llm-anthropic
  • python314Packages.json-schema-to-pydantic
  • python314Packages.llm-anthropic

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. labels Jul 8, 2026
@philiptaron philiptaron marked this pull request as ready for review July 8, 2026 22:55
@philiptaron philiptaron added this pull request to the merge queue Jul 8, 2026
Merged via the queue into NixOS:master with commit 97ba6e2 Jul 8, 2026
28 checks passed
@philiptaron philiptaron deleted the json-schema-to-pydantic-pydantic-2.13-tests branch July 8, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants